<?php

namespace frontend\controllers;

use common\models\input\AlbumSearch;
use Yii;

class AlbumController extends BaseController {

    public function actionIndex() {

        $search = new AlbumSearch();
        $search->setAttributes(Yii::$app->request->get());

        if ($search->pageSize == "" || $search->pageSize == null) {
            $search->pageSize = 100;
        }

        if ($search->page == "" || $search->page == null) {
            $search->page = 1;
        }
        $search->active = 1;
        $dataPage = $search->search(true);
        $id = Yii::$app->request->get('id');
        return $this->render("index", [
                    'dataPage' => $dataPage,
                    'id' => $id
        ]);
    }

}
